import { Router } from 'express';
import {UpLoad, FILE} from '~/utils';
/*
import Config from '~/config';
*/

const router = Router();
/*
let {
  Local,
} = Config;
*/

router.post('/shipment', UpLoad.single('zxwms_shipment'), function (req, res, next) {
  console.log((new Date()).toLocaleString() + '  ' + req.ip + '  ' + req.url + '  接受文件：' + req.file.filename);
  res.send({
    filename: req.file.filename,
  });
});

router.delete('/shipment/:_filename', function (req, res, next) {
  FILE.remove('/excel/zxwms/shipment/' + req.params._filename);
  res.send({
    filename: req.params._filename,
  });
});

export default router;
